#ifndef BMOUSEZOOMIMAGE_H
#define BMOUSEZOOMIMAGE_H

#include <QLabel>
#include <QMouseEvent>
#include <QWheelEvent>
#include <QPixmap>
#include <QHBoxLayout>
#include <QPaintEvent>

class BMouseZoomImage : public QWidget
{
    Q_OBJECT

public:
    BMouseZoomImage(QWidget *parent = nullptr);
    BMouseZoomImage(const QPixmap& pixmap, QWidget *parent = nullptr);
    ~BMouseZoomImage();

private:
    QLabel* m_label;    //显示图片
    QPixmap m_pixmap;     //图片
    double m_scale = 1.0;        //缩放值

protected:
    void wheelEvent(QWheelEvent* event) override;

};
#endif // BMOUSEZOOMIMAGE_H
